﻿using CommunityToolkit.Mvvm.DependencyInjection;
using HanumanInstitute.MvvmDialogs;
using HanumanInstitute.MvvmDialogs.Wpf;
using Microsoft.Extensions.DependencyInjection;
using Resourcer;
using Syncfusion.Licensing;
using System.Windows;
using TS2MP4.Services;
using TS2MP4.ViewModels;
using WPFLocalizeExtension.Engine;

namespace TS2MP4;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
    protected override void OnStartup(StartupEventArgs e)
    {
        Ioc.Default.ConfigureServices(new ServiceCollection()
            .AddSingleton<IDialogService, DialogService>()
            .AddSingleton<IOpenExplorerService, OpenExplorerService>()
            .AddTransient<MainViewModel>()
            .BuildServiceProvider());

        LocalizeDictionary.Instance.Culture = Thread.CurrentThread.CurrentUICulture;

        SyncfusionLicenseProvider.RegisterLicense(Resource.AsString("License.txt"));
    }
}